using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace BetaIto.ChaosDAV
{
    public partial class InputPathForm : Form
    {
        public string Path
        {
            get { return this._pathInput.Text; }
            set { this._pathInput.Text = value; }
        }

        public string Message
        {
            get { return _messageInput.Text; }
            set { _messageInput.Text = value; }
        }

        private bool _folderMode;

        public bool FolderMode
        {
            get { return _folderMode; }
            set { _folderMode = value; }
        }
	
	
	
        public InputPathForm()
        {
            InitializeComponent();
        }

        private void InputPathForm_Load(object sender, EventArgs e)
        {
            Control[] controlList = { _pathLabel };
            ProgramUtility.LoadFormStringsFromResource(controlList, GetType().FullName);

            _pathInput.Focus();
        }

        private void _browserButton_Click(object sender, EventArgs e)
        {
            /*
            OpenFileDialog dialog = new OpenFileDialog();
            dialog.CheckFileExists = false;
            dialog.CheckPathExists = false;
            dialog.ValidateNames = false;
            dialog.FileName = _pathInput.Text;
            if (dialog.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            _pathInput.Text = dialog.FileName;
            */
            if (_folderMode)
            {
                FolderBrowserDialog dialog = new FolderBrowserDialog();
                dialog.SelectedPath = _pathInput.Text;
                if (dialog.ShowDialog(this) != DialogResult.OK)
                {
                    return;
                }
                _pathInput.Text = dialog.SelectedPath;
            }

        }
    }
}